package com.medic.mapper.interf;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.medic.entity.Assitant;
import com.medic.entity.Doctor;
import com.medic.entity.Group;
import com.medic.entity.GroupUser;
import com.medic.entity.Pharmacist;
import com.medic.entity.User;
import com.medic.entity.VerifyRole;


public interface GroupMapper extends MapperInterface<Group> {

	/**
	 * pass为false时是代表查询未通过审核进入组的对象  true时是查找已通过审核进入组并且在某组的对象 
	 * 
	 * @param pass    
	 * @param groupid
	 * @return
	 * @throws Exception
	 */

	public List<Assitant> selectAssitantByGroup(@Param("groupid") int groupid)
			throws Exception;

	public List<Pharmacist> selectPharmacistByGroup( @Param("groupid") int groupid)
			throws Exception;

	public List<Doctor> selectDoctorByGroup(@Param("groupid") int groupid)
			throws Exception;
	
	public List<User>  selectUserByGroup(@Param("where") String where, @Param("groupid") int groupid) throws Exception;

	public void insertGroup(@Param("personid") int personid, @Param("groupid") int groupid,@Param("role") String role,@Param("rtime")long rtime )
			throws Exception;

	
	public void updateGroup(@Param("list") int[] list, @Param("status") int status, @Param("role") String role, @Param("etime") long etime)
			throws Exception;

	
	
	
	public void insertBatchGroup(@Param("list") int[] list, @Param("groupid") int groupid, @Param("role") String role,@Param("etime")long etime, @Param("rtime")long rtime)
			throws Exception;

	public List<Group> selectGroup(String where) throws Exception;

	public void deleteGrouper(@Param("list") int[] list, @Param("groupid") int groupid, @Param("role") String role)
			throws Exception;

	
	public List< Group> selectGroupByRole(@Param("roleid")int roleid,@Param("role") String role)
				throws Exception;
	public void deleteGroup(int groupid) throws Exception;

	
	public void deleteNopassRole(@Param("role") String role,@Param("list") int[] list) throws Exception;
	
	
	public List<User> selectUserNotinGroup(@Param("groupid")int groupid,@Param("where")String where)  throws Exception;
	public List<Doctor> selectDoctorNotinGroup(@Param("groupid")int groupid,@Param("where")String where)  throws Exception;
	public List<Pharmacist> selectPharmacistNotinGroup(@Param("groupid")int groupid,@Param("where")String where)  throws Exception;
	public List<Assitant> selectAssitantNotinGroup(@Param("groupid")int groupid,@Param("where")String where)  throws Exception;

	public Group selectGroupById(int groupid) throws Exception;

	
	public List<VerifyRole> selectNopassRole(@Param("role")String role) throws Exception;


	public List<Group> selectNotinGroupByRole(@Param("role")String role,@Param("roleid")int roleid) throws Exception;
	
	public int selectCountByGroup(@Param("role")String role ,@Param("groupid")int groupid) throws Exception;
	
	
	
	public GroupUser selectGroupUserById(int gid) throws Exception;
	
}
